package cn.johnyu.controller;

import cn.johnyu.pojo.Author;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AuthorController {
    @GetMapping("/author/{id}")
    @Operation(summary = "获取作者信息")

    public Author getAuthor(@PathVariable("id") Integer id) {
        Author author = new Author();
        author.setId(1);
        author.setAddress("北京市海淀区");
        return author;
    }
}
